/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package escr.persistencia;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Aditardo
 */
@Entity
@Table(name = "control_presupuesto")
@NamedQueries({@NamedQuery(name = "ControlPresupuesto.findByCprId", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprId = :cprId"), @NamedQuery(name = "ControlPresupuesto.findByCprParcod", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprParcod = :cprParcod"), @NamedQuery(name = "ControlPresupuesto.findByCprPartida", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprPartida = :cprPartida"), @NamedQuery(name = "ControlPresupuesto.findByCprValor", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprValor = :cprValor"), @NamedQuery(name = "ControlPresupuesto.findByCprEgresado", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprEgresado = :cprEgresado"), @NamedQuery(name = "ControlPresupuesto.findByCprSaldo", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprSaldo = :cprSaldo"), @NamedQuery(name = "ControlPresupuesto.findByCprNota", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprNota = :cprNota"), @NamedQuery(name = "ControlPresupuesto.findByCprFecha", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprFecha = :cprFecha"), @NamedQuery(name = "ControlPresupuesto.findByCprNumc", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprNumc = :cprNumc"), @NamedQuery(name = "ControlPresupuesto.findByCprPorce", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprPorce = :cprPorce"), @NamedQuery(name = "ControlPresupuesto.findByCprTipop", query = "SELECT c FROM ControlPresupuesto c WHERE c.cprTipop = :cprTipop")})
public class ControlPresupuesto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "CPR_ID", nullable = false)
    private Integer cprId;
    @Column(name = "CPR_PARCOD")
    private Integer cprParcod;
    @Column(name = "CPR_PARTIDA")
    private String cprPartida;
    @Column(name = "CPR_VALOR")
    private Double cprValor;
    @Column(name = "CPR_EGRESADO")
    private Double cprEgresado;
    @Column(name = "CPR_SALDO")
    private Double cprSaldo;
    @Column(name = "CPR_NOTA")
    private String cprNota;
    @Column(name = "CPR_FECHA")
    @Temporal(TemporalType.DATE)
    private Date cprFecha;
    @Column(name = "CPR_NUMC")
    private Integer cprNumc;
    @Column(name = "CPR_PORCE")
    private Double cprPorce;
    @Column(name = "CPR_TIPOP")
    private Integer cprTipop;
    @JoinColumn(name = "DOC_COD", referencedColumnName = "DOC_COD")
    @ManyToOne
    private Documento docCod;

    public ControlPresupuesto() {
    }

    public ControlPresupuesto(Integer cprId) {
        this.cprId = cprId;
    }

    public Integer getCprId() {
        return cprId;
    }

    public void setCprId(Integer cprId) {
        this.cprId = cprId;
    }

    public Integer getCprParcod() {
        return cprParcod;
    }

    public void setCprParcod(Integer cprParcod) {
        this.cprParcod = cprParcod;
    }

    public String getCprPartida() {
        return cprPartida;
    }

    public void setCprPartida(String cprPartida) {
        this.cprPartida = cprPartida;
    }

    public Double getCprValor() {
        return cprValor;
    }

    public void setCprValor(Double cprValor) {
        this.cprValor = cprValor;
    }

    public Double getCprEgresado() {
        return cprEgresado;
    }

    public void setCprEgresado(Double cprEgresado) {
        this.cprEgresado = cprEgresado;
    }

    public Double getCprSaldo() {
        return cprSaldo;
    }

    public void setCprSaldo(Double cprSaldo) {
        this.cprSaldo = cprSaldo;
    }

    public String getCprNota() {
        return cprNota;
    }

    public void setCprNota(String cprNota) {
        this.cprNota = cprNota;
    }

    public Date getCprFecha() {
        return cprFecha;
    }

    public void setCprFecha(Date cprFecha) {
        this.cprFecha = cprFecha;
    }

    public Integer getCprNumc() {
        return cprNumc;
    }

    public void setCprNumc(Integer cprNumc) {
        this.cprNumc = cprNumc;
    }

    public Double getCprPorce() {
        return cprPorce;
    }

    public void setCprPorce(Double cprPorce) {
        this.cprPorce = cprPorce;
    }

    public Integer getCprTipop() {
        return cprTipop;
    }

    public void setCprTipop(Integer cprTipop) {
        this.cprTipop = cprTipop;
    }

    public Documento getDocCod() {
        return docCod;
    }

    public void setDocCod(Documento docCod) {
        this.docCod = docCod;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cprId != null ? cprId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ControlPresupuesto)) {
            return false;
        }
        ControlPresupuesto other = (ControlPresupuesto) object;
        if ((this.cprId == null && other.cprId != null) || (this.cprId != null && !this.cprId.equals(other.cprId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escr.persistencia.ControlPresupuesto[cprId=" + cprId + "]";
    }

}
